/*
 * Copyright (C) 2004, Velocityme Partnership
 * DirectoryDTO.java
 *
 * Created on 22 July 2005, 06:27
 */

package com.velocityme.utility;

import com.velocityme.valueobjects.ContactDetailTypeValue;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.Collection;

/**
 *
 * @author  Robert
 */
public class DirectoryDTO implements Serializable {
    
    public class Row implements Serializable {
        public static final int ORGANISATION = 0;
        public static final int DEPARTMENT = 1;
        public static final int PERSON = 2;
        private int m_nodeId;
        private int m_type;
        private String m_path;
        private String m_name;
        private String[] m_values;
        
        public Row(int nodeId, int type, String path, String name, String[] values) {
            m_nodeId = nodeId;
            m_type = type;
            m_path = path;
            m_name = name;
            m_values = values;
        }
        
        public int getNodeId() { return m_nodeId; }
        public int getType() { return m_type; }
        public String getPath() { return m_path; }
        public String getName() { return m_name; }
        public String[] getValues() { return m_values; }
    }
    
    ContactDetailTypeValue[] m_contactDetailTypeValues;
    Collection m_rows;
    
    /** Creates a new instance of DirectoryDTO */
    public DirectoryDTO(ContactDetailTypeValue[] contactDetailTypeValues) {
        m_contactDetailTypeValues = contactDetailTypeValues;
        m_rows = new ArrayList();
    }
    
    public void addRow(int nodeId, int type, String path, String name, String[] values) {
        m_rows.add(new Row(nodeId, type, path, name, values));
    }
    
    public ContactDetailTypeValue[] getContactDetailTypeValues() {
        return m_contactDetailTypeValues;
    }
    
    public Collection getRows() {
        return m_rows;
    }
    
}
